<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            background-image: url(pic.jpg);
            width: 800px;
            height: 600px;
            /* 背景平铺 ,一共有四个属性 repeat no-repeat repeat-x repeat-y */
            background-repeat: no-repeat;
            background-color: rgb(247, 16, 16);
            /* 背景方位 */
            /* 方位名词前后名词顺序没关系 */

            background-position: center right;
            /* 背景图片固定 默认的是不固定 */
            background-attachment: fixed;


        }
    </style>
</head>

<body>
    <div> </div>
</body>

</html>